<template>
  <div>
    <el-row>
            <p><b>首页</b>/下订单/支付订单</p>
    </el-row>

    <el-row>
        <el-table
            :data="allOrder"
            style="width: 100%"
            >
            <el-table-column
            fixed
            prop="id"
            label="订单号"
            >
            </el-table-column>
            <el-table-column
            prop="orderSrcChannel"
            label="来源渠道"
            >
            </el-table-column>
            <el-table-column
            prop="paymentDivide"
            label="支付方式"
            >
            </el-table-column>
            <el-table-column
            prop="orderSalPrice"
            label="商品价格"
            >
            </el-table-column>
            <el-table-column
            prop="freight"
            label="运费"
            >
            </el-table-column>
            <el-table-column
            prop="orderTotalFee"
            label="实付金额"
            >
            </el-table-column>
            <el-table-column
            prop="remark"
            label="备注"
            >
            </el-table-column>
           
            <el-table-column
            fixed="right"
            label="操作"
            >
            <template slot-scope="scope">
              <el-button type="primary" @click="payBtn(scope.row.id)">支付订单</el-button>
            </template>
            </el-table-column>
        </el-table>
    </el-row>

    <el-row>
      <el-col>
        <el-pagination
                background
                :page-sizes="[3, 5, 10, 30]"
                :page-size="pageSize"
                :current-page="pageNum"
                layout="prev, pager, next, total, sizes"
                :total="total"
                @next-click="nextPage"
                @prev-click="prevPage"
                @current-change="changePage"
                @size-change="changeSize"
                >
        </el-pagination>
      </el-col>
    </el-row>

  </div>
</template>

<script>

export default {
  data() {
    return {
      pageSize:10,
      pageNum:1,
      total:0,
      allOrder:[],
    }
  },

  methods: {
    queryAllOrder(){
      let pageData={}
      pageData.pageSize=this.pageSize
      pageData.pageNum=this.pageNum
      this.$axios.post('apig/css-order/queryAllOrder',pageData).then(resp=>{
        this.allOrder=resp.data.data.list
        this.total=resp.data.data.total
        // console.log(resp.data)
      })
    },

    payBtn(id){
      window.open('http://localhost:8100/alipay/pay?rsNo='+id)
      // console.log(id)
    },

    //下一页方法
    nextPage(val){
                    //回调参数val,val等于当前页码
                    this.pageNum=val
                    this.queryAllOrder()
    },
    //上一页方法
    prevPage(val){
                    //回调参数val,val等于当前页码
                    this.pageNum=val
                    this.queryAllOrder()
    },
    changePage(val){
                    this.pageNum=val
                    this.queryAllOrder()
    },
    changeSize(val){
                    this.pageSize=val
                    this.pageNum=1
                    this.queryAllOrder()
    },
  },

  created(){
    this.queryAllOrder()

  },
}
</script>

<style scoped>
</style>